<template>
  <div>
    <h2>代码高亮</h2>
    <FormattedCode :formatted="formatted"></FormattedCode>
  </div>
</template>

<script type="text/javascript">
import code from '@/code/program';
import formatCode from '@/list-walker/format';
import getTokenList from '@/utils/getTokenList';

export default {
  data() {
    const tokenList = getTokenList(code);

    const formatted = formatCode(tokenList, code);

    return {
      formatted,
    };
  },
};
</script>

<style type="text/css">
</style>
